﻿using System.Collections.Generic;

namespace JamesZhao.Engine
{
    public class ConfigCategory
    {
        private readonly Dictionary<string, object> _values = new Dictionary<string, object>();

        public void Set(string key, object value)
        {
            _values[key] = value;
        }

        public T Get<T>(string key, object defaultValue = null)
        {
            if (_values.ContainsKey(key))
                return (T) _values[key];
            return (T) defaultValue;
        }
    }
}